C---------------------------------------------------------
C    TOOLPACK/1    Release: 3.1
C---------------------------------------------------------
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.4
C---------------------------------------------------------
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.4
C---------------------------------------------------------
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.4
C---------------------------------------------------------
 
 
 
 
 
 
 
 
C                                   parameter length
 
 
 
 
 
 
 
 
 
C following are for ZYCSDT (Canonicalise Symbol Data Types)
        PROGRAM ISTYF
 
        INTEGER TREPTH(81),SYMPTH(81),CMIPTH(81),
     +          TKOPTH(81),CMOPTH(81),CMTPTH(81),JUNK,
     +          IODTRE,IODSYM,IODCMI,IODCMT,IODTKO,IODCMO,TKDESC
 
        INTEGER OPEN,CREATE,GETARG,ZYINCI,ZTKPTI
        EXTERNAL OPEN,CREATE,ERROR,ZINIT,ZQUIT,ZYINSY,ZYINPT,REMARK,
     +           GETARG,ZYINCI,ZTKPTI
 
        CALL ZINIT
 
        IF (GETARG(1,TREPTH,81).EQ.-100) CALL YFARGS(1,TREPTH)
        IF (GETARG(2,SYMPTH,81).EQ.-100) CALL YFARGS(2,SYMPTH)
        IF (GETARG(3,CMIPTH,81).EQ.-100) CALL YFARGS(3,CMIPTH)
        IF (GETARG(4,CMTPTH,81).EQ.-100) CALL YFARGS(4,CMTPTH)
        IF (GETARG(5,TKOPTH,81).EQ.-100) CALL YFARGS(5,TKOPTH)
        IF (GETARG(6,CMOPTH,81).EQ.-100) CALL YFARGS(6,CMOPTH)
 
        IODTRE=OPEN(TREPTH,0)
        IF (IODTRE.EQ.-1) CALL ERROR('Can''t open parse tree')
        IODSYM=OPEN(SYMPTH,0)
        IF (IODSYM.EQ.-1) CALL ERROR('Can''t open symbol table')
        IODCMI=OPEN(CMIPTH,0)
        IF (IODCMI.EQ.-1) CALL ERROR('Can''t open comment index')
        IODCMT=OPEN(CMTPTH,0)
        IF (IODCMT.EQ.-1) CALL ERROR('Can''t open comment file')
        IODTKO=CREATE(TKOPTH,1)
        IF (IODTKO.EQ.-1) CALL ERROR('Can''t create token stream')
        IODCMO=CREATE(CMOPTH,1)
        IF (IODCMO.EQ.-1) CALL ERROR('Can''t create comment stream')
        TKDESC=ZTKPTI(1,IODTKO,IODCMO)
 
        CALL ZYINPT(IODTRE)
        CALL ZYINSY(IODSYM)
        IF (ZYINCI(IODCMI).NE.-2) CALL ERROR('ZYINCI failed')
 
        CALL PROFIL(IODCMT,TKDESC)
 
        CALL REMARK('[ISTYF Normal Termination]')
        CALL ZQUIT(-2)
 
        END
C ----------------------------------------------------------------------
C
C       Y F A R G S   -   Get a YF command argument
C
 
        SUBROUTINE YFARGS(NUMBER,PATH)
        INTEGER NUMBER,PATH(81)
 
        INTEGER ZGTCMD
        EXTERNAL ZGTCMD,ZPRMPT
 
        INTEGER I,PROMPT(24,6)
 
        SAVE PROMPT
 
C "Input parse tree: "
C "Input symbol table: "
C "Input comment index: "
C "Input comment stream: "
C "Output token stream: "
C "Output comment stream: "
 
        DATA (PROMPT(I,1),I=1,19)/73,110,112,117,116,32,112,
     +97,114,115,101,32,116,114,101,101,58,32,129/,
     +       (PROMPT(I,2),I=1,21)/73,110,112,117,116,32,115,
     +121,109,98,111,108,32,116,97,98,108,101,58,
     +32,129/,
     +       (PROMPT(I,3),I=1,22)/73,110,112,117,116,32,99,
     +111,109,109,101,110,116,32,105,110,100,101,120,
     +58,32,129/,
     +       (PROMPT(I,4),I=1,23)/73,110,112,117,116,32,99,
     +111,109,109,101,110,116,32,115,116,114,101,97,109,
     +58,32,129/,
     +       (PROMPT(I,5),I=1,22)/79,117,116,112,117,116,32,
     +116,111,107,101,110,32,115,116,114,101,97,109,
     +58,32,129/,
     +       (PROMPT(I,6),I=1,24)/79,117,116,112,117,116,32,
     +99,111,109,109,101,110,116,32,115,116,114,101,97,
     +109,58,32,129/
 
        CALL ZPRMPT(PROMPT(1,NUMBER))
        IF (ZGTCMD(PATH,0).EQ.-1) CALL ERROR('YFARGS: I/O ERROR')
 
        END
C ----------------------------------------------------------------------
C
C       P R O F I L   -   Process files
C
 
        SUBROUTINE PROFIL(IODCMT,TKDESC)
        INTEGER IODCMT,TKDESC
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.4
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        INTEGER ZYDOWN,ZYNEXT,ZYROOT
        EXTERNAL ZYDOWN,ZYNEXT,ZYROOT,ZTOKWR
 
        SAVE
 
        INTEGER PTR,DUMMY(2)
 
        DATA DUMMY(1)/129/
 
        PTR=ZYDOWN(ZYROOT())
 
 100    IF (PTR.GT.0) THEN
            CALL PROPU(PTR,IODCMT,TKDESC)
            PTR=ZYNEXT(PTR)
            GO TO 100
        END IF
        CALL ZTOKWR(TZEOF,0,DUMMY,TKDESC)
 
        END
C ----------------------------------------------------------------------
C
C       P R O P U   -   Process Program-Unit
C
 
        SUBROUTINE PROPU(PUROOT,IODCMT,TKDESC)
        INTEGER PUROOT,IODCMT,TKDESC
 
        INTEGER SPTR,SNUM,BUFF(134)
 
        INTEGER ZYDOWN,ZYNEXT,ZYGTCM,ZYGNCM,LENGTH
        EXTERNAL ZYDOWN,ZYNEXT,ZYGTCM,ZYGNCM,LENGTH,YSTMT,ZTOKWR
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.4
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        SAVE
 
        DATA SNUM/1/
 
        SPTR=ZYDOWN(PUROOT)
 
 100    IF (ZYGTCM(IODCMT,SNUM,BUFF).EQ.-2) THEN
 200        CALL ZTOKWR(TCMMNT,LENGTH(BUFF),BUFF,TKDESC)
            IF (ZYGNCM(IODCMT,BUFF).EQ.-2) GO TO 200
        END IF
        CALL YSTMT(SPTR,TKDESC)
        SNUM=SNUM+1
        SPTR=ZYNEXT(SPTR)
        IF (SPTR.NE.0) GOTO 100
 
        END
